# Magentic-One 是一个通用的多代理系统，用于解决跨多个领域的开放式网页和文件任务。这代表了多代理系统的重要进步，在一系列代理基准测试中取得了具有竞争力的表现（详见技术报告获取完整细节）。
from autogen_agentchat.agents import AssistantAgent, UserProxyAgent
from autogen_agentchat.conditions import MaxMessageTermination, TextMentionTermination
from autogen_agentchat.messages import AgentEvent, ChatMessage
from autogen_agentchat.teams import SelectorGroupChat, MagenticOneGroupChat
from autogen_agentchat.ui import Console
from autogen_ext.models.openai import OpenAIChatCompletionClient
async def main() -> None:
    model_client = OpenAIChatCompletionClient(model="qwen2.5:7b",
                                              model_info={
                                                  "vision": False,
                                                  "function_calling": True,
                                                  "family": "Qwen3",
                                                  "structured_output": True,
                                                  "json_output": True,
                                              },
                                              api_key="ollama",
                                              base_url="http://127.0.0.1:11434/v1")
    assistant = AssistantAgent(
        "Assistant",
        model_client=model_client,
    )
    team = MagenticOneGroupChat([assistant], model_client=model_client)
    await Console(team.run_stream(task="为费马大定理提供另一种证明方法。"))

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())